<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>01</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<script type="text/javascript" src="vue.js"></script>
</head>
<body>
        <div id="app">{{date | formatDate}}</div>
    <script>
        var padDate = function(value){
            return value < 10 ? '0'+ value :value;
        };
        var myApp = new Vue({
            el: '#app',
            data: {
                date:new Date(),
                package1:[
                    {
                    name : 'iphone 7',
                    price : 7199,
                    count : 2
                    },
                    {
                    name : 'ipad',
                    price : 2888,
                    count : 1
                    }         
                ],
                package2 :[
                {
                    name: 'apple',
                    price :3,
                    count :5
            },{
                    name: 'banana',
                    price :2,
                    count :10
            }
                ]
            },
            filters :{
                formatDate:function(value){
                        // console.log(value)
                        var date = new Date(value);
                        var year = date.getFullYear();
                        var month = padDate(date.getMonth()+1);
                        var day = padDate(date.getDate());
                        var hours = padDate(date.getHours());
                        var minutes = padDate(date.getMinutes());
                        var seconds = padDate(date.getSeconds());
                        return year + '-' + month + '-' + day + '-' +hours  + ':' + minutes  + ":" +seconds;
                }
            },
            mounted:function () {
                this.$nextTick(function () {
                                       var _this = this ;
                                        this.timer = setInterval(function(){
                                            _this.date = new Date();
                                        },1000)
                })
            },
            beforeDestroy:function(){
                if(this.timer){
                    clearInterval(this.timer);
                }
            }
        })
    </script>
    <script type="text/javascript">
        console.log(0b111110111 === 503);
        console.log(0o767 === 503);

    </script>
</body>
</html>